package com.itheima.d07_io_encode_question;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;

public class Test {

    public static void main(String[] args) {
        try (

                //1.获取原始字节流
                InputStream is = new FileInputStream("day11_io\\src\\com\\itheima\\d07_io_encode_question\\haiyan.txt");

                //2.按照文件真实的字符集    转换成   字符流
                Reader reader = new InputStreamReader(is,"GBK");

        ) {

            System.out.println((char)reader.read());
            System.out.println((char)reader.read());
            System.out.println((char)reader.read());
            System.out.println((char)reader.read());
            System.out.println((char)reader.read());
            System.out.println((char)reader.read());

        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
}
